\doxysubsection{Bilinear Interpolation }
\hypertarget{group___bilinear_interpolate}{}\label{group___bilinear_interpolate}\index{Bilinear Interpolation@{Bilinear Interpolation}}
\doxysubsubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE float32\+\_\+t \mbox{\hyperlink{group___bilinear_interpolate_ga887756dbbe013d0a15b987836a787677}{arm\+\_\+bilinear\+\_\+interp\+\_\+f32}} (const \mbox{\hyperlink{structarm__bilinear__interp__instance__f32}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+f32}} \texorpdfstring{$\ast$}{*}S, float32\+\_\+t X, float32\+\_\+t Y)
\begin{DoxyCompactList}\small\item\em Floating-\/point bilinear interpolation. \end{DoxyCompactList}\item 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q31\+\_\+t \mbox{\hyperlink{group___bilinear_interpolate_gaefe4731017e8b9ac652e5fea57cb1fa5}{arm\+\_\+bilinear\+\_\+interp\+\_\+q31}} (\mbox{\hyperlink{structarm__bilinear__interp__instance__q31}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q31}} \texorpdfstring{$\ast$}{*}S, q31\+\_\+t X, q31\+\_\+t Y)
\begin{DoxyCompactList}\small\item\em Q31 bilinear interpolation. \end{DoxyCompactList}\item 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q15\+\_\+t \mbox{\hyperlink{group___bilinear_interpolate_ga56fe34273ffb422f428b1d9feeffe0ea}{arm\+\_\+bilinear\+\_\+interp\+\_\+q15}} (\mbox{\hyperlink{structarm__bilinear__interp__instance__q15}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q15}} \texorpdfstring{$\ast$}{*}S, q31\+\_\+t X, q31\+\_\+t Y)
\begin{DoxyCompactList}\small\item\em Q15 bilinear interpolation. \end{DoxyCompactList}\item 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q7\+\_\+t \mbox{\hyperlink{group___bilinear_interpolate_ga1230bb062f6d8614db10b37ba7c9a161}{arm\+\_\+bilinear\+\_\+interp\+\_\+q7}} (\mbox{\hyperlink{structarm__bilinear__interp__instance__q7}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q7}} \texorpdfstring{$\ast$}{*}S, q31\+\_\+t X, q31\+\_\+t Y)
\begin{DoxyCompactList}\small\item\em Q7 bilinear interpolation. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. The underlying function {\ttfamily f(x, y)} is sampled on a regular grid and the interpolation process determines values between the grid points. Bilinear interpolation is equivalent to two step linear interpolation, first in the x-\/dimension and then in the y-\/dimension. Bilinear interpolation is often used in image processing to rescale images. The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-\/point data types.

{\bfseries{Algorithm}} \begin{DoxyParagraph}{}
The instance structure used by the bilinear interpolation functions describes a two dimensional data table. For floating-\/point, the instance structure is defined as\+: 
\begin{DoxyPre}
  typedef struct
  \{
    uint16\_t numRows;
    uint16\_t numCols;
    float32\_t *pData;
\} \doxylink{structarm__bilinear__interp__instance__f32}{arm\_bilinear\_interp\_instance\_f32};
\end{DoxyPre}

\end{DoxyParagraph}
\begin{DoxyParagraph}{}
where {\ttfamily num\+Rows} specifies the number of rows in the table; {\ttfamily num\+Cols} specifies the number of columns in the table; and {\ttfamily p\+Data} points to an array of size {\ttfamily num\+Rows\texorpdfstring{$\ast$}{*}num\+Cols} values. The data table {\ttfamily p\+Table} is organized in row order and the supplied data values fall on integer indexes. That is, table element (x,y) is located at {\ttfamily p\+Table\mbox{[}x + y\texorpdfstring{$\ast$}{*}num\+Cols\mbox{]}} where x and y are integers.
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
Let {\ttfamily (x, y)} specify the desired interpolation point. Then define\+: 
\begin{DoxyPre}
    XF = floor(x)
    YF = floor(y)
\end{DoxyPre}
 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
The interpolated output point is computed as\+: 
\begin{DoxyPre}
 f(x, y) = f(XF, YF) * (1-\/(x-\/XF)) * (1-\/(y-\/YF))
          + f(XF+1, YF) * (x-\/XF)*(1-\/(y-\/YF))
          + f(XF, YF+1) * (1-\/(x-\/XF))*(y-\/YF)
          + f(XF+1, YF+1) * (x-\/XF)*(y-\/YF)
\end{DoxyPre}
 Note that the coordinates (x, y) contain integer and fractional components. The integer components specify which portion of the table to use while the fractional components control the interpolation processor.
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
\end{DoxyParagraph}


\label{doc-func-members}
\Hypertarget{group___bilinear_interpolate_doc-func-members}
\doxysubsubsection{Function Documentation}
\Hypertarget{group___bilinear_interpolate_ga887756dbbe013d0a15b987836a787677}\index{Bilinear Interpolation@{Bilinear Interpolation}!arm\_bilinear\_interp\_f32@{arm\_bilinear\_interp\_f32}}
\index{arm\_bilinear\_interp\_f32@{arm\_bilinear\_interp\_f32}!Bilinear Interpolation@{Bilinear Interpolation}}
\doxysubsubsubsection{\texorpdfstring{arm\_bilinear\_interp\_f32()}{arm\_bilinear\_interp\_f32()}}
{\footnotesize\ttfamily \label{group___bilinear_interpolate_ga887756dbbe013d0a15b987836a787677} 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE float32\+\_\+t arm\+\_\+bilinear\+\_\+interp\+\_\+f32 (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structarm__bilinear__interp__instance__f32}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+f32}} \texorpdfstring{$\ast$}{*}}]{S}{, }\item[{float32\+\_\+t}]{X}{, }\item[{float32\+\_\+t}]{Y}{}\end{DoxyParamCaption})}



Floating-\/point bilinear interpolation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{in,out}}  & {\em S} & points to an instance of the interpolation structure. \\
\hline
\mbox{\texttt{in}}  & {\em X} & interpolation coordinate. \\
\hline
\mbox{\texttt{in}}  & {\em Y} & interpolation coordinate. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out interpolated value. 
\end{DoxyReturn}
\Hypertarget{group___bilinear_interpolate_ga56fe34273ffb422f428b1d9feeffe0ea}\index{Bilinear Interpolation@{Bilinear Interpolation}!arm\_bilinear\_interp\_q15@{arm\_bilinear\_interp\_q15}}
\index{arm\_bilinear\_interp\_q15@{arm\_bilinear\_interp\_q15}!Bilinear Interpolation@{Bilinear Interpolation}}
\doxysubsubsubsection{\texorpdfstring{arm\_bilinear\_interp\_q15()}{arm\_bilinear\_interp\_q15()}}
{\footnotesize\ttfamily \label{group___bilinear_interpolate_ga56fe34273ffb422f428b1d9feeffe0ea} 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q15\+\_\+t arm\+\_\+bilinear\+\_\+interp\+\_\+q15 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structarm__bilinear__interp__instance__q15}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q15}} \texorpdfstring{$\ast$}{*}}]{S}{, }\item[{q31\+\_\+t}]{X}{, }\item[{q31\+\_\+t}]{Y}{}\end{DoxyParamCaption})}



Q15 bilinear interpolation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{in,out}}  & {\em S} & points to an instance of the interpolation structure. \\
\hline
\mbox{\texttt{in}}  & {\em X} & interpolation coordinate in 12.\+20 format. \\
\hline
\mbox{\texttt{in}}  & {\em Y} & interpolation coordinate in 12.\+20 format. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out interpolated value. 
\end{DoxyReturn}
\Hypertarget{group___bilinear_interpolate_gaefe4731017e8b9ac652e5fea57cb1fa5}\index{Bilinear Interpolation@{Bilinear Interpolation}!arm\_bilinear\_interp\_q31@{arm\_bilinear\_interp\_q31}}
\index{arm\_bilinear\_interp\_q31@{arm\_bilinear\_interp\_q31}!Bilinear Interpolation@{Bilinear Interpolation}}
\doxysubsubsubsection{\texorpdfstring{arm\_bilinear\_interp\_q31()}{arm\_bilinear\_interp\_q31()}}
{\footnotesize\ttfamily \label{group___bilinear_interpolate_gaefe4731017e8b9ac652e5fea57cb1fa5} 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q31\+\_\+t arm\+\_\+bilinear\+\_\+interp\+\_\+q31 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structarm__bilinear__interp__instance__q31}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q31}} \texorpdfstring{$\ast$}{*}}]{S}{, }\item[{q31\+\_\+t}]{X}{, }\item[{q31\+\_\+t}]{Y}{}\end{DoxyParamCaption})}



Q31 bilinear interpolation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{in,out}}  & {\em S} & points to an instance of the interpolation structure. \\
\hline
\mbox{\texttt{in}}  & {\em X} & interpolation coordinate in 12.\+20 format. \\
\hline
\mbox{\texttt{in}}  & {\em Y} & interpolation coordinate in 12.\+20 format. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out interpolated value. 
\end{DoxyReturn}
\Hypertarget{group___bilinear_interpolate_ga1230bb062f6d8614db10b37ba7c9a161}\index{Bilinear Interpolation@{Bilinear Interpolation}!arm\_bilinear\_interp\_q7@{arm\_bilinear\_interp\_q7}}
\index{arm\_bilinear\_interp\_q7@{arm\_bilinear\_interp\_q7}!Bilinear Interpolation@{Bilinear Interpolation}}
\doxysubsubsubsection{\texorpdfstring{arm\_bilinear\_interp\_q7()}{arm\_bilinear\_interp\_q7()}}
{\footnotesize\ttfamily \label{group___bilinear_interpolate_ga1230bb062f6d8614db10b37ba7c9a161} 
\+\_\+\+\_\+\+STATIC\+\_\+\+FORCEINLINE q7\+\_\+t arm\+\_\+bilinear\+\_\+interp\+\_\+q7 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structarm__bilinear__interp__instance__q7}{arm\+\_\+bilinear\+\_\+interp\+\_\+instance\+\_\+q7}} \texorpdfstring{$\ast$}{*}}]{S}{, }\item[{q31\+\_\+t}]{X}{, }\item[{q31\+\_\+t}]{Y}{}\end{DoxyParamCaption})}



Q7 bilinear interpolation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{in,out}}  & {\em S} & points to an instance of the interpolation structure. \\
\hline
\mbox{\texttt{in}}  & {\em X} & interpolation coordinate in 12.\+20 format. \\
\hline
\mbox{\texttt{in}}  & {\em Y} & interpolation coordinate in 12.\+20 format. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out interpolated value. 
\end{DoxyReturn}
